package com.ruoyi.business.dao;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.Customer;
import com.ruoyi.business.mapper.CustomerMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@RequiredArgsConstructor
public class CustomerDao extends ServiceImpl<CustomerMapper, Customer> {

    private final CustomerMapper customerMapper;

    public List<Customer> selectCustomerList(Customer customer) {
        return lambdaQuery()
                .eq(Customer::getId, customer.getId())
                .eq(Customer::getName, customer.getName())
                .eq(Customer::getContactName, customer.getContactName())
                .eq(Customer::getContactAddress, customer.getContactAddress())
                .eq(Customer::getContactPhone, customer.getContactPhone())
                .eq(Customer::getCode, customer.getCode())
                .list();
    }
}
